| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Quaternion.h
1 // Quaternion.h
3 //
5
6 namespace nkMaths
7 {
13 class Quaternion
14 {
15 public :
16
21 Quaternion () noexcept ;
30 Quaternion (float x, float y, float z, float w) noexcept ;
37 Quaternion (const Vector& axis, float angle) noexcept ;
43 Quaternion (const Vector& eulerAngles) noexcept ;
49 Quaternion (const Matrix& mat) noexcept ;
55 Quaternion (const Quaternion& other) noexcept ;
56
60 Vector getAsEulerAngles () const ;
64 Vector getAsAxisAngle () const ;
65
73 Quaternion& setFromAxisAngle (const Vector& axis, float angle) ;
80 Quaternion& setFromEuler (const Vector& angles) ;
87 Quaternion& setFromOrientationMatrix (const Matrix& mat) ;
94 Quaternion& setFromTransformationMatrix (const Matrix& mat) ;
95
96 // Transformations
104 Vector transform (const Vector& vector) const ;
112 Vector& apply (Vector& vector) const ;
113
114 // Utilities
118 nkMemory::String toString () const ;
126 Quaternion& fromString (nkMemory::StringView str) ;
127
128 // Operators
134 Quaternion& operator= (const Quaternion& other) noexcept ;
141 Vector operator* (const Vector& other) const ;
148 Quaternion operator* (const Quaternion& other) const ;
154 void operator*= (const Quaternion& other) ;
161 bool operator== (const Quaternion& other) const ;
162
163 public :
164
165 // Attributes
166 float _x ;
167 float _y ;
168 float _z ;
169 float _w ;
170 } ;
171 }
nkMaths::Quaternion::getAsAxisAngle
Vector getAsAxisAngle() const
nkMaths::Quaternion::_z
float _z
Z component of the quaternion.
Definition: Quaternion.h:168
nkMaths
Encompasses all API of component NilkinsMaths.
Definition: IntVector.h:7
nkMaths::Quaternion
A quaternion, symbolizing rotations as a 4D vector.
Definition: Quaternion.h:14
nkMaths::Quaternion::apply
Vector & apply(Vector &vector) const
nkMaths::Quaternion::setFromEuler
Quaternion & setFromEuler(const Vector &angles)
nkMaths::Matrix
Represents a 4x4 float matrix.
Definition: Matrix.h:14
nkMaths::Quaternion::_y
float _y
Y component of the quaternion.
Definition: Quaternion.h:167
nkMaths::Quaternion::setFromAxisAngle
Quaternion & setFromAxisAngle(const Vector &axis, float angle)
nkMaths::Quaternion::toString
nkMemory::String toString() const
nkMaths::Quaternion::setFromOrientationMatrix
Quaternion & setFromOrientationMatrix(const Matrix &mat)
nkMaths::Quaternion::setFromTransformationMatrix
Quaternion & setFromTransformationMatrix(const Matrix &mat)
nkMaths::Quaternion::Quaternion
Quaternion() noexcept
nkMaths::Quaternion::transform
Vector transform(const Vector &vector) const
nkMaths::Quaternion::_x
float _x
X component of the quaternion.
Definition: Quaternion.h:166
nkMaths::Quaternion::_w
float _w
W component of the quaternion.
Definition: Quaternion.h:169
nkMaths::Quaternion::fromString
Quaternion & fromString(nkMemory::StringView str)
nkMaths::Quaternion::getAsEulerAngles
Vector getAsEulerAngles() const
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkMemory
Encompasses all API of component NilkinsMemory.
Definition: Allocator.h:7